﻿// =================================================================== 
// 项目说明
//====================================================================
// 文件： ERP_PerReStore.cs
// 创建时间：2016/12/4
// 负责人：
// ===================================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using CRMMis.Model;
using CRMMis.IDAL;


namespace MSSQLDAL
{
    /// <summary>
    /// 数据层实例化接口类  借还表.
    /// </summary>
    public partial class ERP_PerReStoreDAL : IERP_PerReStoreDAL
    {
		//此处写查询数据的sql语句，


        //if QueryDataString==""，DAL层的GetList，GetRecordCount等函数将直接存取ERP_PerReStore表


        //if QueryDataString!=""，则DAL层的GetList，GetRecordCount等函数将存取该SQL语句，取代表
		//注意：所写sql语句执行结果的字段必须是唯一的

		private const string QueryDataString = @"SELECT a.*,b.STOREROOM_NAME,c.USER_NAME as InUser_Name,e.USER_NAME as OwnerName,
                d.USER_NAME as checkName FROM ERP_PerReStore a
                LEFT JOIN VIEW_STORE b ON a.StoreRoomId=b.STOREROOM_ID
                LEFT JOIN SYS_USER c ON a.InUser= c.USER_ID
                LEFT JOIN SYS_USER d ON a.CheckUser= d.USER_ID
                LEFT JOIN SYS_USER e ON a.Owner=e.USER_ID";
    }
}
